package cn.iyunbei.handself.greendao;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import cn.iyunbei.handself.bean.GoodsBeanDao;
import cn.iyunbei.handself.bean.OrderBeanDao;
import cn.iyunbei.handself.bean.OrderIdDao;

import cn.iyunbei.handself.greendao.GoodsBeanDaoDao;
import cn.iyunbei.handself.greendao.OrderBeanDaoDao;
import cn.iyunbei.handself.greendao.OrderIdDaoDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig goodsBeanDaoDaoConfig;
    private final DaoConfig orderBeanDaoDaoConfig;
    private final DaoConfig orderIdDaoDaoConfig;

    private final GoodsBeanDaoDao goodsBeanDaoDao;
    private final OrderBeanDaoDao orderBeanDaoDao;
    private final OrderIdDaoDao orderIdDaoDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        goodsBeanDaoDaoConfig = daoConfigMap.get(GoodsBeanDaoDao.class).clone();
        goodsBeanDaoDaoConfig.initIdentityScope(type);

        orderBeanDaoDaoConfig = daoConfigMap.get(OrderBeanDaoDao.class).clone();
        orderBeanDaoDaoConfig.initIdentityScope(type);

        orderIdDaoDaoConfig = daoConfigMap.get(OrderIdDaoDao.class).clone();
        orderIdDaoDaoConfig.initIdentityScope(type);

        goodsBeanDaoDao = new GoodsBeanDaoDao(goodsBeanDaoDaoConfig, this);
        orderBeanDaoDao = new OrderBeanDaoDao(orderBeanDaoDaoConfig, this);
        orderIdDaoDao = new OrderIdDaoDao(orderIdDaoDaoConfig, this);

        registerDao(GoodsBeanDao.class, goodsBeanDaoDao);
        registerDao(OrderBeanDao.class, orderBeanDaoDao);
        registerDao(OrderIdDao.class, orderIdDaoDao);
    }
    
    public void clear() {
        goodsBeanDaoDaoConfig.clearIdentityScope();
        orderBeanDaoDaoConfig.clearIdentityScope();
        orderIdDaoDaoConfig.clearIdentityScope();
    }

    public GoodsBeanDaoDao getGoodsBeanDaoDao() {
        return goodsBeanDaoDao;
    }

    public OrderBeanDaoDao getOrderBeanDaoDao() {
        return orderBeanDaoDao;
    }

    public OrderIdDaoDao getOrderIdDaoDao() {
        return orderIdDaoDao;
    }

}
